package com.sugar.follow.up.module.business.dal.mysql.config;

import java.util.*;

import com.sugar.follow.up.framework.common.pojo.PageResult;
import com.sugar.follow.up.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.follow.up.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.follow.up.module.business.dal.dataobject.config.BizConfigDO;
import org.apache.ibatis.annotations.Mapper;
import com.sugar.follow.up.module.business.controller.admin.config.vo.*;

/**
 * 参数配置 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface BizConfigMapper extends BaseMapperX<BizConfigDO> {

    default PageResult<BizConfigDO> selectPage(BizConfigPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BizConfigDO>()
                .likeIfPresent(BizConfigDO::getName, reqVO.getName())
                .eqIfPresent(BizConfigDO::getConfigKey, reqVO.getConfigKey())
                .betweenIfPresent(BizConfigDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BizConfigDO::getId));
    }

}